<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
    <title>地图显示</title>
    <style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }
        .amap-icon img,
        .amap-marker-content img{
            width: 25px;
            height: 34px;
        }
    </style>
</head>
<body>
	<div id="test" style="width:450px;height:100px;overflow:scroll;">
		<select>
		  <option value =""></option>
		</select>
	</div>
</body>
<body>
<div id="container"></div>
<!-- 加载地图JSAPI脚本 -->
<script src="https://webapi.amap.com/maps?v=1.4.15&key=1adc13484c61e9e0320b086e5e2744f6"></script>
<script>	
	var basePath;
	$(function() {
		var location = (window.location + '').split('/');
		basePath = location[0] + '//' + location[2] + '/' + location[3];
	});
	function getCarNames() {
		var data = []
		$.ajax({
			url : basePath + "/getTrainName.do",
			data : {
				},
			async:false,
			type : 'get',
			success : function(result) {
				data.push(result);
			}
		});
	}   
	
	function init() {
		getCarNames();
		map = new AMap.Map('container', {
			resizeEnable: true, //是否监控地图容器尺寸变化
			zoom:20, //初始化地图层级
			center: [116.397428, 39.90923] //初始化北京为地图中心点
		});
	}
</script>
<body style="height:100%" onload="init()">
</body>
</html>